<%@ include file="/taglibs.jsp" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 

<head>
		<title>北京邮电大学学生党员在线学习中心</title>
		<link href="${ctx}/css/pagination.css" rel="stylesheet" type="text/css" />
		<link type="text/css" rel="stylesheet" href="${ctx}/styles/jquery-ui-1.8.16.custom.css" />
		<script type="text/javascript" src="${ctx}/ckeditor/ckeditor.js"></script>
		<script type="text/javascript" src="${ctx}/scripts/jquery-1.6.2.js"></script>
		<script type="text/javascript" src="${ctx}/scripts/jquery-datepicker.js"></script>
		<script type="text/javascript" src="${ctx}/scripts/jquery-ui-1.8.16.custom.min.js"></script>
		
		<script type="text/javascript">
		$(function() {
			$('#posttopic').bind('click', function(){
				new_topic();
			});
			
		});
		</script>
		<script type="text/javascript">
		  function new_topic()
	      {
			 try
			 { 
			   var title = document.getElementById("title");
			   var editor_data = CKEDITOR.instances.content.getData();
				
			   if(title.value.replace(/(^\s*)/g, "") == "")
			   {
			       alert("请输入标题!");
			       title.focus();
			       return false;
			   }
			   
			   if(title.value.length > 60) {
				   alert("标题超过了60个字符，请重新输入标题");
				   title.focus();
				   return false;
			   }
			   
			   if(editor_data==null || editor_data==""){
					alert("请输入发布的内容");
					CKEDITOR.instances.content.focus();
					return false;
				}
			   
			   $('#postLearnCenter')[0].submit();   //提交submit
			   }
			   catch(e)
			   {
			       alert(e);
			   }
	    }
    </script>
 
</head>
<div id="nav_bar">
    <img id="nav_bar_left" src="../../../styles/nav_bar_left.png" alt=""/>
    <div id="welcome_label">欢迎您，&nbsp;<s:property value="#session.session_user.adminName" />!</div>
    <img id="nav_bar_seperator" src="../../../styles/nav_bar_seperator.png" alt=""/>
    <div id="nav_location">
        <img id="nav_bar_point" src="../../../styles/nav_bar_point.png" alt="" />
        <div id="nav_cur_location">当前位置：&nbsp;<a href="${ctx}/AdminNoticeAction_adminNotice">学习公告管理</a>&nbsp;&nbsp;>&nbsp;&nbsp;<a href="${ctx}/AdminNoticeAction_adminNotice">学习公告</a>&nbsp;&nbsp;>&nbsp;&nbsp;修改学习公告</div>
    </div>
    <img style="float:right; width:5px;" src="../../../styles/nav_bar_right.png" alt=""/>
    <a id="nav_logout" href="${ctx}/logoutAction_adminLogout">[安全退出]</a>
</div>

<div style="clear:both; height:20px;">&nbsp;</div>

		<div style="margin-left:auto; margin-right:auto; width:96%;">
	   <form name="postLearnCenter" action="AdminNoticeAction_updateNotice" method="post" id="postLearnCenter" onsubmit="return new_topic();">
	   <table>
			<tr>
				<td >
				<b>标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
				</td>
 				<td >
 				<input type="text" name="title" id="title"  maxlength="60" style="width:99%" value="<s:property value="learnCenter.title"/>"/>
				</td>
			</tr>
			<tr>
				<td>
				<b>内&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;容：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
				</td>
 				<td >
 					<ckfinder:setupCKEditor editor="content" basePath="ckfinder"/>
            		<ckeditor:editor basePath="ckeditor/" editor="content" value="${learnCenter.content}" /> 
				</td>
			</tr>
		</table>
		    
		 <br/>
  		
		<div style="text-align:center;">
			<input id="posttopic" name="posttopic" type="button" value="保存" class="input-button" />&nbsp;&nbsp;&nbsp;&nbsp;
		    <input  id="history" name="history" type="button" class="input-button" value="返回" onclick="window.location.href='javascript:history.go(-1);'"/>
		</div>
		
	    <input type="hidden" name="id" value="<s:property value="learnCenter.id" />" />
	    <input type="hidden" name="flag" value="<s:property value="flag"/>" />
	    <input type="hidden" name="queryTitle" value="<s:property value="queryTitle"/>" />
	   </form>
</div>
	     
